package com.ruoyi.project.system.v.controller;

import com.ruoyi.project.system.v.service.StreamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StreamController {

    @Autowired
    private StreamService streamService;

    @PostMapping("/start-stream")
    public String startStream() {
        try {
            streamService.startStream();
            return "Stream started successfully!";
        } catch (Exception e) {
            e.printStackTrace();
            return "Failed to start stream: " + e.getMessage();
        }
    }
}
